#include <BSP/Fan.h>
#include <atomic>

static std::atomic<uint8_t> g_fan_level = 0; // 0~3

extern "C" void set_fan(int level)
{
    if (level < 0) level = 0;
    if (level > 3) level = 3;
    g_fan_level.store(level,std::memory_order_release);
}

extern "C" int get_fan(void)
{
    return g_fan_level.load(std::memory_order_acquire);
}

